<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		
		<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
		<link rel='stylesheet' href='css/main2.css' type='text/css'>
		<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
		<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />

		
	</head>

	<body>
		<div data-role="page"  data-theme="b">
			
			<header data-tap-toggle="false" data-position="fixed" data-role="header" role="banner">
				
				<a href="#menuPanel" data-role="button" data-icon="bars" data-iconpos="notext" data-theme="a" data-inline="true">Bars</a>
				
				<h1 id="centerheader">
					<a href="main">
						<img src="resources/img/aa.png" alt="" />
					</a>
				</h1>
				<h5>${sessionScope.userLoginInfo.name}님 환영합니다.</h5>
				<a href="#rightpanel" data-role="button" data-icon="grid" data-iconpos="notext" data-theme="a" data-inline="true">Grid</a>
				
			</header>
							
			
			
			<section id="menuPanel" data-display="overlay" data-position-fixed="true" data-role="panel"  data-theme="b">
			<div class="ui-panel-inner" ><nav class="main-nav">
				<ul class="menupanel_one">
					<li>
					<a href="main" data-lid="home" class="ui-link active">MAIN</a>
					</li>
					
					<li>
					<a data-lid="vehicles" class="ui-link">업무보고</a>
					</li>
						<ul class="menupanel_two">
							<li>
								<a href="reportingregist" data-lid="mobile_apps" class="ui-link">등 록</a>
							</li>
							<li>
								<a href="todayreporting" data-lid="mobile_apps" class="ui-link">일일업무</a>
							</li>
							<li>
								<a href="weekreporting" data-lid="mobile_apps" class="ui-link">주간업무</a>
							</li>
							<li>
								<a href="monthreporting" data-lid="mobile_apps" class="ui-link">월간업무</a>
							</li>
						</ul>
					<li>
						
					<a data-lid="vehicles" class="ui-link">회의록</a>
					
					</li>
						<ul class="menupanel_two">
							<li>
								<a href="minutesregist" data-lid="mobile_apps" class="ui-link">등 록</a>
							</li>
							<li>
								<a href="minuteslist" data-lid="mobile_apps" class="ui-link">지난 회의록</a>
							</li>
						</ul>
				
					<li>
						<a data-lid="mobile_apps" class="ui-link">거래처 관리</a>
					</li>
						<ul class="menupanel_two">
							<li>
								<a href="accountlist" data-lid="mobile_apps" class="ui-link">거래처 보기</a>
							</li>
							<li>
								<a href="accountregist" data-lid="mobile_apps" class="ui-link">거래처 등록</a>
							</li>							
						</ul>
					
					<li>
						<a href="location" data-lid="owner_site" >팀원 위치 보기</a>
					</li>
					
					<li>
						<a href="#companybbs" data-lid="owner_site" >사내 게시판</a>
					</li>
						
					<li>
						<a data-lid="owner_site" >PT</a>
					</li>
						<ul class="menupanel_two">
							<li>
								<a href="ptregist" data-lid="mobile_apps" class="ui-link">등 록</a>
							</li>
							<li>
								<a href="ptview" data-lid="mobile_apps" class="ui-link">보 기</a>
							</li>							
						</ul>
					
				</ul>
				</nav></div>
			</section>	
			
			
					
			<div data-role="panel" id="rightpanel" data-display="overlay" data-position="right" data-theme="b">
				
			</div>
			
			
			<form>
			    <label for="text-10">회의 주제</label>
			    <input type="text" disabled="disabled" value='${minVO.title }'>
			    <label for="text-10">회의 일자</label>
			    <input type="text" disabled="disabled" value='${minVO.openDay }'>
			    <label for="text-10">참가 인원</label>
			    <input type="text" disabled="disabled" value='${minVO.personnel }'>
			    <label for="text-10">장 소</label>
			    <input type="text" disabled="disabled" value='${minVO.place }'>
			    <label for="textarea-10">회의 내용</label>
			    <textarea id="minutesViewTextArea" disabled="disabled" cols="40" rows="8" style="height : 300px;"></textarea>
			</form>
			
			
			<form method="post" data-ajax="ture">
			    <textarea cols="40" rows="8" name="reply" id="reply" placeholder="댓글" style="height:100px;"></textarea>
				<input type="hidden" name="replyer" id="replyer" value=${sessionScope.userLoginInfo.epid}>
				<input type="hidden" name="bbsNo" id="bbsNo" value='${minVO.seqno}'>
				<a id="replyregist" data-role="button" data-mini="true" data-inline="true">등록</a>	
			</form>
			
			
			
			<div id='replylist'></div>
			
			
			<form>
				<input type="hidden" id="temptextarea" value='${minVO.content }'>
				<input type="hidden" id="seqno" value='${minVO.seqno }'>
			</form>
			
			
			
			
			
		<script>		
					
			function textAreaInput(data){
						
				$('#minutesViewTextArea').val($('#temptextarea').val());
						
						
			}

			
			function minutesReply(){
				
				$.get("minutesviewreply",{"seqno" : $('#seqno').val()}).done(function(data){
				
					if (data.length > 0) {
						
						console.log("success!!");
						
						replyLoad(data);
				
					} else { 
					
						console.log("fail!");
						
					
						return;
					
					}
					
				});
				
			}
			
			
			function replyLoad(data){

			
				var replylist = "";
				
				for(var i = 0 ; i < data.length-1 ; i++){
					
					replylist += "<div>"; 
					replylist += "<input type='text' disabled='disabled'id='"+ data[i].seqno +"' value='글쓴이 : " + data[i].name + "               일자 : " + data[i].regdate + "'>";
					replylist += "<textarea disabled='disabled' cols='40' rows='8' style='height : 100px;'>" + data[i].reply + "</textarea>";
					replylist += "</div>"
				}
				
				$('#replylist').html(replylist).trigger("create");
				
				
			}
			
			
			$('#replyregist').click(function(){
				
				$.post('minutesregistaction', {"reply" : $('#reply').val(), "replyer" : $('#replyer').val(), "bbsNo" : $('#bbsNo').val()}
				).done(
						
					minutesReply()
	
				);
				
				
			});
			
			minutesReply();
			textAreaInput();
		</script>
</body>
</html>
























